<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <%@ include file="IsProff.jsp"%>
        <%@ include file="..\master\head.jsp"%>
    </head>
    <body>
        <div id="container">
            <div id="wrapper">
                <div id="sidebar">
                    <div id="sb_top"><%@ include file="..\master\sbTop.jsp"%>
                    <%@ include file="IsProff.jsp"%></div>
                    
                    <div class="sb_content"><!--##########--> <!-- Start Menu --> <%@ include
         file="..\master\Profmenu.jsp"%> <!-- Profile -->
<%@ include file="..\master\profile.jsp"%> <!-- links -->
<%@ include file="..\master\links.jsp"%>
                        <div class="copyright"><%@ include file="..\master\copyright.jsp"%>
                        </div>
                    </div>
                <!-- /sb_content --></div>
                <!-- /sidebar --> <!-- Top -->
                <div id="header"><%@ include file="..\master\header.jsp"%>
                </div>
                
                
                <!-- Start main content -->
                <div id="content">
                    <div id="intro">
                        <div class="intro_t">
                            <h1><span>..</span>Welcome to<span>..</span></h1>
                            <h2>student project management system</h2>
                            
                        </div>
                    </div>
                    <!-- /intro -->
<%@ page import="database.*, java.util.*, java.sql.*" %>
<%=request.getParameter("wrong") == null ? "" : "<h2 class='wrong'>There are wrongs in input</h2>"%>


<%
            try {
                out.print(request.getParameter("projID"));
                ResultSet res = new DBCon().getProject(" where id =" + request.getParameter("projID"));

                if (res.next()) {
%>

                    <form action="../DB/ProjectUpdate.jsp" method="post">
                        <input type="hidden" name="id" value="<%=res.getString("id")%>">
                        <h3>Title:</h3>
                        <input type="text" name="title" value='<%=res.getString("Title")%>' /><br />
                        <h3>Description:</h3>
                        <textarea rows="4" cols="60" name="descr"> <%=res.getString("Description")%></textarea>
                        <h3>Project Objectives:</h3>
                        <textarea rows="4" cols="60" name="obj" >dfsfasfasfd <%=res.getString("Project_Objectives")%></textarea>
                        <h3>Required Background:</h3>
                        <textarea rows="4" cols="60" type="text" size=40 name="req"  ><%=res.getString("Required_Background")%></textarea><br />
                        <h3>Tools Needed:</h3>
                        <textarea rows="4" cols="60" type="text" size=40 name="tools"  ><%=res.getString("Tools_Needed")%></textarea><br />
                        <h3>Difficulty Level:</h3>
                        <%
                String level = res.getString("Difficulty_Level");

                String easy = "", med = "", dif = "";
                if (level.equals("easy")) {
                    easy = "selected";
                } else if (level.equals("medium")) {
                    med = "selected";
                } else if (level.equals("Difficult")) {
                    dif = "selected";
                }
                        %>
                        <select name="diff">
                            <option value="easy" <%=easy%> >Easy</option>
                            <option value="medium" <%=med%> >Medium</option>
                            <option value="Difficult" <%=dif%> >Difficult</option>
                        </select>
                        <h3>Project Type:</h3>
                        <textarea type="text" name="type" ><%=res.getString("Project_type")%></textarea><br />
                        <h3>Project Keywords:</h3>
                        <textarea type="text" name="keywords" ><%=res.getString("Project_Keywords")%></textarea><br />
                        <h3>Expected Results:</h3>
                        <textarea type="text" name="results" ><%=res.getString("Expected_Results")%></textarea><br />
                        <h3>Additional Comments:</h3>
                        <textarea rows="4" cols="60" name="comments" value='<%=res.getString("Additional_Comments")%>'></textarea><br />
                        <input type="submit" value="Update Project"/>
                    </form>
                    <%
                }
            } catch (Exception e) {
                response.sendRedirect("../connectionFailed.jsp?" + e);
            }
                    
                    %>
                </div>
            <!-- /content --></div>
            <!-- /wrapper -->
            <div class="clear">&nbsp;</div>
        <!-- Important! Fix the problem of height in Firefox --></div>
        <!-- /Container -->

        
    </body>
</html>